import { IPSThreshold } from './ipsthreshold';
import { IPSLanguageRes } from '../res/ipslanguage-res';
import { IPSSysCss } from '../res/ipssys-css';
import { IPSSysImage } from '../res/ipssys-image';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSThresholdImpl extends PSModelObjectImpl implements IPSThreshold {
  get bKColor(): string {
    return this.M.bKColor;
  }

  get beginValue(): number {
    return this.M.beginValue;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get color(): string {
    return this.M.color;
  }

  get data(): string {
    return this.M.data;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get endValue(): number {
    return this.M.endValue;
  }

  get memo(): string {
    return this.M.memo;
  }

  get name(): string {
    return this.M.name;
  }

  protected pssyscss: IPSSysCss | null = null;

  getPSSysCss(): IPSSysCss | null {
    if (this.pssyscss != null) return this.pssyscss;
    const value = this.M.getPSSysCss;
    if (value == null) {
      return null;
    }
    this.pssyscss = this.getPSModel4('res.IPSSysCss', value, 'getPSSysCss') as IPSSysCss;
    return this.pssyscss;
  }

  get psSysCss(): IPSSysCss | null {
    return this.getPSSysCss();
  }

  getPSSysCssMust(): IPSSysCss {
    const value = this.getPSSysCss();
    if (value == null) {
      throw new Error('未指定显示样式');
    }
    return value;
  }

  protected pssysimage: IPSSysImage | null = null;

  getPSSysImage(): IPSSysImage | null {
    if (this.pssysimage != null) return this.pssysimage;
    const value = this.M.getPSSysImage;
    if (value == null) {
      return null;
    }
    this.pssysimage = this.getPSModel4('res.IPSSysImage', value, 'getPSSysImage') as IPSSysImage;
    return this.pssysimage;
  }

  get psSysImage(): IPSSysImage | null {
    return this.getPSSysImage();
  }

  getPSSysImageMust(): IPSSysImage {
    const value = this.getPSSysImage();
    if (value == null) {
      throw new Error('未指定图标对象');
    }
    return value;
  }

  get text(): string {
    return this.M.text;
  }

  protected textpslanguageres: IPSLanguageRes | null = null;

  getTextPSLanguageRes(): IPSLanguageRes | null {
    if (this.textpslanguageres != null) return this.textpslanguageres;
    const value = this.M.getTextPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.textpslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getTextPSLanguageRes') as IPSLanguageRes;
    return this.textpslanguageres;
  }

  get textPSLanguageRes(): IPSLanguageRes | null {
    return this.getTextPSLanguageRes();
  }

  getTextPSLanguageResMust(): IPSLanguageRes {
    const value = this.getTextPSLanguageRes();
    if (value == null) {
      throw new Error('未指定文本语言资源');
    }
    return value;
  }

  get thresholdTag(): string {
    return this.M.thresholdTag;
  }

  get thresholdTag2(): string {
    return this.M.thresholdTag2;
  }

  get tooltip(): string {
    return this.M.tooltip;
  }

  protected tooltippslanguageres: IPSLanguageRes | null = null;

  getTooltipPSLanguageRes(): IPSLanguageRes | null {
    if (this.tooltippslanguageres != null) return this.tooltippslanguageres;
    const value = this.M.getTooltipPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.tooltippslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getTooltipPSLanguageRes') as IPSLanguageRes;
    return this.tooltippslanguageres;
  }

  get tooltipPSLanguageRes(): IPSLanguageRes | null {
    return this.getTooltipPSLanguageRes();
  }

  getTooltipPSLanguageResMust(): IPSLanguageRes {
    const value = this.getTooltipPSLanguageRes();
    if (value == null) {
      throw new Error('未指定提示信息语言资源');
    }
    return value;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get includeBeginValue(): boolean {
    return this.M.includeBeginValue != null ? this.M.includeBeginValue : false;
  }

  get includeEndValue(): boolean {
    return this.M.includeEndValue != null ? this.M.includeEndValue : false;
  }

  get cls(): string {
    return 'PSThresholdImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'codelist.IPSThreshold') return true;
    return super.instanceof(cls);
  }
}
